/*
 * test.cpp
 *
 *  Created on: 14.6.2012
 *      Author: pengliu
 */

#include <iostream>
#include <vector>
#include <string>

using namespace std;
int main(){
	vector<string> SS;

	SS.push_back("the number is 10");
	SS.push_back("the number is 20");
	SS.push_back("the number is 30");
	cout<< "loop by index:"<<endl;
	int ii;
	for(ii=0;ii<SS.size();ii++){
		cout<<SS[ii]<<endl;
	}
	cout <<endl<<"constant iterator:"<<endl;
	vector<string>::const_iterator cii;
	for(cii=SS.begin();cii!=SS.end();cii++){
		cout<< *cii <<endl;
	}
	vector<string>::reverse_iterator rii;
	for(rii=SS.rbegin();rii!=SS.rend();++rii){
		cout<<*rii<<endl;
	}
	cout<<endl<<"sample output:"<<endl;
	cout<<SS.size()<<endl;
	cout<<SS[2]<<endl;
	swap(SS[0],SS[2]);
	cout<<SS[2]<<endl;
	return 0;

}
